<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link type="text/css" href="css/index.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="js/PageTool.js"></script>
<title>智慧城市 - 衡阳</title>
</head>
<body>
	<header style="background: #006291; height: 70px; width: 100%;"
		id="top">
		<img style="height: 70px; margin-left: 30px;" src="images/title.png"
			alt="智慧城市">
		<ul
			style="height: 70px; list-style: none; position: absolute; top: 0; right: 30px; font-family: '幼圆';">
			<li
				style="height: 70px; width: 120px; line-height: 70px; font-size: 20px; float: left; text-align: center;">
				<a style="color: white; text-decoration: none;" href="index.jsp">首页</a>
			</li>
			<li
				style="height: 70px; width: 120px; line-height: 70px; font-size: 20px; float: left; text-align: center;">
				<a style="color: white; text-decoration: none;" href="#scenery_d">景点</a>
			</li>
			<li
				style="height: 70px; width: 120px; line-height: 70px; font-size: 20px; float: left; text-align: center;">
				<a style="color: white; text-decoration: none;" href="tickets.html">车票/机票</a>
			</li>
			<li
				style="height: 70px; width: 120px; line-height: 70px; font-size: 20px; float: left; text-align: center;">
				<a style="color: white; text-decoration: none;"
				href="#travel_agency">旅行社</a>
			</li>
			<li
				style="height: 70px; width: 120px; line-height: 70px; font-size: 20px; float: left; text-align: center;">
				<a style="color: white; text-decoration: none;" href="#travel_way">旅行线路</a>
			</li>
			<li
				style="height: 70px; width: 120px; line-height: 70px; font-size: 20px; float: left; text-align: center;">
				<a style="color: white; text-decoration: none;" href="search.html">出行</a>
			</li>
			<li
				style="height: 70px; width: 120px; line-height: 70px; font-size: 20px; float: left; text-align: center;">
				<a style="color: white; text-decoration: none;" href="#forum_title">旅游论坛</a>
			</li>
		</ul>
	</header>
	<div class="scenery">
    	<a href="javascript:goTo('left')" class="scenery_toleft"><</a>
        <a href="javascript:goTo('right')" class="scenery_toright">></a>
        <ul id="scenery_ul">
        <script type="text/javascript">
        	$(function(){
        		$.ajax({
        		    url: "../json/LocalInfo_getLocalInfoList",    //请求的url地址
        		    dataType: "json",   //返回格式为json
        		    async: true, //请求是否异步，默认为异步，这也是ajax重要特性
        		    type: "POST",
        		    success: function(data) {
        		    	var info1="";
        		    	for(var i=0;i<data.rows.length;i++){
        		    		if(i<=2){
        		    			info1+="<li><a href='javascript:lookDetail("+(data.rows)[i].lid+")'>";
            		    		info1+="<img class='scenery_img' src='"+(data.rows)[i].lpic+"' alt='"+(data.rows)[i].lname+"'>";
            		    		info1+="<p class='scenery_text'>"+(data.rows)[i].ltext+"</p></a></li>";
        		    		}
        		    	}
        	            $("#scenery_ul").html(info1);
        	            var info2="";
        	            for(var i=0;i<data.rows.length;i++){
        		    		if(i<=2){
        		    			info2+="<tr><td style='width:180px;'><img class='scenery_img' src='"+(data.rows)[i].lpic+"' alt='"+(data.rows)[i].lname+"'></td>";
        		    			info2+="<td style='width:90px;'>"+(data.rows)[i].lname+"</td>";
        		                info2+="<td style='font-size:12px;text-align:left;width:600px;'>"+(data.rows)[i].ltext+"</td><td>";
        		                info2+="<input class='see_btn' type='button' value='查看详情' onClick='lookDetail("+(data.rows)[i].lid+")'/></td></tr>";
        		    		}
        		    	}
        	            $("#scenery_table").html(info2);
        	            var info3 = '<tr style="font-size:12px;color:#666;height:50px;background:#ccc;">';
                        info3 += '<td  style="width:100px;">景点</td><td>简介</td>';
                        info3 += '<td style="width:200px;"></td></tr>';
        	            $.each(data.rows,function(index,item){
        	            	if(index < 3){
        	            		 info3 += '<tr style="height:20px;"></tr><tr style="height:40px;"><td>'+item.lname+'</td>';
        	                     info3 += '<td style="font-size:12px;width:500px;line-height:25px;text-align:left;">'+item.lintrouduce+'</td>';
        	                     info3 += '<td><input class="see_btn" type="button" value="前往论坛" onClick="goBBS('+item.lid+')"/></td></tr>';
        	            	}
        	            });
        	            $("#scenery_forum").html(info3);
        	            var info3="";
        	            for(var i=0;i<data.rows.length;i++){
        	            	
        		    	}
        	            $("#forum_table").html(info2);
        		    }
        		});
        	});
        </script>
        </ul>
    </div>
	<div class="scenery_d" id="scenery_d">
		<div id="scenery_d_title">
			<p style="width: 150px; float: left;">
				<span style="font-weight: bold; color: #FF7F00;">|&nbsp;</span>景点信息
			</p>
			<p class="sd_search">
				<input type="text" maxlength="10" placeholder="搜索景点"
					id="search_info" /><input id="search_btn" type="button" value="搜索"
					onClick="searchInfo()" />
			</p>
		</div>
		<table id="scenery_table" border="0px" cellspacing="0px"
			style="border-collapse: collapse; width: 100%; text-align: center; margin: 20px 0 0 10px;">

		</table>
	</div>
	<div class="travel_agency" id="travel_agency">
		<p id="travel_agency_title" style="position: relative;">
			<span style="font-weight: bold; color: #FF7F00;">|&nbsp;</span>旅行社信息
			<a id="changeOnePI" href="javascript:changeOnePI();">换一批</a>
		</p>
		<ul id="travel_ul">
			<script type="text/javascript">
			var mess;
			var pt;
    		$(function(){
        		$.ajax({
        		    url: "../json/AgencyInfo_getAgencyInfoList",    //请求的url地址
        		    dataType: "json",   //返回格式为json
        		    async: true, //请求是否异步，默认为异步，这也是ajax重要特性
        		    type: "POST",
        		    success: function(data) {
        		    	if(data.total>0){
        		    		mess=data;
        		    		pt=new PageTool(6,data.total);
        		    		showAgencyInfo(mess,pt.begin(),pt.end());
        		    	}
        		    }
        		});
        	});
    		
    		//换一批旅行社
    		function changeOnePI(){
    			pt.cyc();
    			console.info(pt)
    			showAgencyInfo(mess, pt.begin(), pt.end());
    		}
    		
    		function showAgencyInfo(data,begin,end){
   				var lis="";
   				$.each(data.rows,function(index,item){
   					if(index>=begin && index<end){
   						lis+="<li><p class='travel_agency_name'>"+item.aname+"<span>"+item.atel+"</span></p>";
    		    		lis+="<p class='travel_agency_pos'>旅行社地址："+item.aaddr+"</p><p class='travel_agency_intro'>简介:"+item.aintroduce+"</p>";
    		    		lis+="<p class='travel_agency_price'>价格:￥"+item.aprice+"</p></li>";
   					}
   				});
   				$("#travel_ul").html(lis);
   			}
    		</script>
		</ul>
	</div>
	<div class="travel_way" id="travel_way">
		<p id="travel_way_title">
			<span style="font-weight: bold; color: #FF7F00;">|&nbsp;</span>旅行线路推荐
		</p>
		<ul id="way_ul">
			<script>
    		$(function(){
        		$.ajax({
        		    url: "../json/WayInfo_getWayInfoList",    //请求的url地址
        		    dataType: "json",   //返回格式为json
        		    async: true, //请求是否异步，默认为异步，这也是ajax重要特性
        		    type: "POST",
        		    success: function(data) {
        		    	var info="";
        		    	for(var i=0;i<data.rows.length;i++){
        		    		info+='<li><img id="way_img" src="images/way.png" alt="线路">';
        	            	info+="<div id='way_info'><p>预计花费时间：<span>"+(data.rows)[i].wtime+"天</span></p>";
        	            	info+="<p>预计经费：<span>"+(data.rows)[i].wcost+"元</span></p>";
        	                info+="<p>线路：<span>"+(data.rows)[i].wway+"</span></p></div></li>";
        		    	}
        		    	$("#way_ul").html(info);
        		    }
        		});
        	});
    		</script>
		</ul>
	</div>
	 <div class="forum">
    	<p id="forum_title">
        	<span style="font-weight:bold;color:#FF7F00;">|&nbsp;</span>旅游论坛
        </p>
        <table id="scenery_forum" border="0px" cellspacing="0px" style="border-collapse:collapse;width:100%;text-align:center;margin:20px 0 0 10px;">
        	<tr style="font-size:12px;color:#666;height:50px;background:#ccc;">
                <td  style="width:100px;">景点</td>
                <td>简介</td>
                <td style="width:150px;"></td>
            </tr>
            
        </table>
    </div>
	<div id="to_top" title="返回顶部">
		<img src="images/to_top.png" alt="返回顶部"
			style="padding: 10%; width: 80%; height: 80%;" />
	</div>
	<footer style="height: 70px; background: #E6E6E6;">
		<p style="line-height: 70px; font-size: 16px; text-align: center;">CopyRight
			&copy; 智慧城市 - 衡阳 All rights reserved.</p>
	</footer>
</body>
</html>
